package com.ruoyi.web.config;

import com.tbit.openapi.business.sms.service.SmsService;
import com.tbit.openapi.core.ApiClient;
import com.tbit.openapi.core.ApiClientBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class TbitOpenApiBeanConfig {
    /**
     * 优驱API HTTP客户端，能自动完成请求签名
     * 所有优驱API业务service都依赖该客户端
     */
    @Bean
    public ApiClient apiClient() {
        return ApiClientBuilder.create()
                .appId("n4v0486h")
                .appSecret("58b4233e320f4d9892ab72eec34656bd")
                .build();
    }

    /**
     * 短信服务
     */
    @Bean
    public SmsService smsService(ApiClient apiClient) {
        return new SmsService(apiClient);
    }
}